#!/usr/bin/env perl

use strict;

BEGIN {
	use Cwd;
	if(exists($::ENV{LINUXHA_LIBPING6_PATH})) {
		push @::INC,$::ENV{LINUXHA_LIBPING6_PATH};
	} else {
		$::ENV{LINUXHA_LIBPING6_PATH}=getcwd();
	}
}

use libping6;

my $p6=new libping6(TIMEOUT=>0.003,HOST=>"::1");
my ($a,$b)=$p6->ping6();
if($a>0.0) {
	printf("Response time for ::1 is %.5f seconds.\n",$a);
	exit(0);
} else {
	print "Failed to ping ::1 - $b\n";
	exit(1);
}

